﻿using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;
using System.Xml.Serialization;
using zEngine;
using zEngine.GameObjs;
using zEngine.Cameras;
using FYP.Profilings;

namespace FYP.TestCases
{
    class TestCase5 : TestCase2
    {
        private Model _mediumLODModel;
        private Model _lowLODModel;

        #region Properties
        public Model LowLODModel
        {
            get { return _lowLODModel; }
            set { _lowLODModel = value; }
        }
        public Model MediumLODModel
        {
            get { return _mediumLODModel; }
            set { _mediumLODModel = value; }
        }
        #endregion

        /// <summary>
        /// Initializes a new instance of the TestCase1 class.
        /// </summary>
        public TestCase5(Game game, SpriteBatch sb)
            : base(game, sb)
        {
            TestcaseName = "Rendering profile with level of detail system";
            DataFileOutput = "Data\\TestCase5.xml";
        }

        public override void Initialize()
        {
            base.Initialize();
            Renderer.CheckInsight = false;
            Renderer.UseLODImpostor = true;
            Renderer.DistanceLevels.AddRange(new double[] { 500, 1000 });
        }

        public override void LoadContent()
        {
            base.LoadContent();

            _mediumLODModel = Game.Content.Load<Model>("Characters\\cman2m");
            _lowLODModel = Game.Content.Load<Model>("Characters\\cman2l");
        }

        public override zObject AddMoreCharacter()
        {
            zObject newObj = base.AddMoreCharacter();
            newObj.LODEnabled = true;
            newObj.Models = new List<Model>(new Model[3]{MainModel3D, _mediumLODModel, _lowLODModel});
            return newObj;
        }
    }
}
